<!doctype html>
<html>
<?php echo $this->fetch('head.html'); ?>

<body>

<div class="body">
<div class="header" > <a href="<?php echo $this->_var['appshop']; ?>?m=coupon"  class="left-btn"><span class="iconfont icon-back"></span></a>
    <div class="title">优惠券编辑</div>
    
  </div>
    <form method='post' action='<?php echo $this->_var['appshop']; ?>?m=coupon&a=save'>
    <input type="hidden" name="type_id" value="4">
      <input type='hidden' name='id' style='display:none;' value='<?php echo $this->_var['data']['id']; ?>' >
      <table class='table table-bordered' width='100%'>
        <tr>
          <td width="100">名称：</td>
          <td><input type='text' name='title' id='title' value='<?php echo $this->_var['data']['title']; ?>' ></td>
        </tr>
         
        <tr>
          <td>抵消价格：</td>
          <td><input type='text' name='money' id='money'    value='<?php echo $this->_var['data']['money']; ?>' ></td>
        </tr>
        
        <tr>
          <td>最低消费价格：</td>
          <td><input type='text' name='lower_money' id='lower_money'    value='<?php echo $this->_var['data']['lower_money']; ?>' ></td>
        </tr>
        
        <tr>
          <td>总数量：</td>
          <td><input type='text' name='amount' id='amount'   value='<?php echo $this->_var['data']['amount']; ?>' ></td>
        </tr>
        <tr>
          <td>领取数量：</td>
          <td><?php echo $this->_var['data']['get_num']; ?></td>
        </tr>
        
        <tr>
          <td>使用数量：</td>
          <td><?php echo $this->_var['data']['use_num']; ?></td>
        </tr>
        <tr>
              <td>图片：</td>
              <td> <div id="up1" url="/index.php?m=upload&a=uploadtao&dir=shop_product&id=<?php echo $this->_var['data']['id']; ?>">
    	<div class="btn-upload">
          <input type="file" name="upimg" id="ud"  class="btn-upload-file" onChange="uploadimg('up1')">
         </div>
 
          <input type="hidden" name="imgurl" class="imgurl" value="<?php echo $this->_var['data']['imgurl']; ?>">
          <span class="imgShow">
          <?php if ($this->_var['data']['imgurl']): ?>
          <img src="<?php echo images_site($this->_var['data']['imgurl']); ?>.100x100.jpg">
          <?php endif; ?>
          </span>
      </div></td>
            </tr>
        
        <tr>
          <td>截止日期：</td>
          <td><input type='text' name='end_time' id='end_time'   value='<?php if ($this->_var['data']): ?><?php echo date("Y-m-d H:i:s",$this->_var['data']['end_time']); ?><?php endif; ?>'  onClick="WdatePicker({startDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd HH:mm'})" ></td>
        </tr>
        <?php if ($this->_var['data']): ?>
        <tr>
          <td>创建时间：</td>
          <td><?php echo date("Y-m-d H:m",$this->_var['data']['dateline']); ?></td>
        </tr>
        <?php endif; ?>
        <tr>
          <td>状态：</td>
          <td><input type='radio' name='status' id='status' value='1' <?php if ($this->_var['data']['status'] == 1): ?> checked="checked" <?php endif; ?> >
            显示
            <input type='radio' name='status' id='status' value='0' <?php if ($this->_var['data']['status'] != 1): ?> checked="checked" <?php endif; ?>>
            隐藏 </td>
        </tr>
        
        
        
        <tr>
          <td></td>
          <td><input type='submit' value='保存' class='btn btn-success'></td>
        </tr>
      </table>
    </form>
  </div>
</div>
<script language="javascript" src="/plugin/My97DatePicker/WdatePicker.js"></script>
<script src="/plugin/skyweb/lrz.mobile.min.js"></script>
<script src="/static/js/upload_wap.js"></script>
<script language="javascript">

$(document).ready(function(e) {
    $("#amount").bind("keyup",function(){
		$("#total_money").html($(this).val());
	});
});

</script>
<?php echo $this->fetch('footer.html'); ?>